# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=ruby-public_suffix
_gemname=public_suffix
pkgver=4.0.7
pkgrel=0
pkgdesc="Domain name parser for Ruby based on the Public Suffix List"
url="https://simonecarletti.com/code/publicsuffix/"
arch="noarch"
license="MIT"
depends="ruby"
source="https://github.com/weppos/publicsuffix-ruby/archive/v$pkgver/ruby-public_suffix-$pkgver.tar.gz
	gemspec.patch
	"
builddir="$srcdir/publicsuffix-ruby-$pkgver"
options="!check"  # FIXME: tests require additional dependencies

build() {
	gem build $_gemname.gemspec
}

package() {
	local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')"

	gem install \
		--local \
		--install-dir "$gemdir" \
		--ignore-dependencies \
		--no-document \
		--verbose \
		$_gemname

	# Remove unnecessary files and rubbish...
	cd "$gemdir"
	rm -r cache build_info doc
}

sha512sums="
bbba6a977ab70c9a4ecf80aed9f5e1d5eec5c6def25ea3601d5529241ab6fa89fa134c187fb31aca0997aef937f1fbfd6581ac30f4c4a4aeb98cd486b318decb  ruby-public_suffix-4.0.7.tar.gz
2d928fc40ad36b2dfa3be922507a9ca750ad660c06e59cc1b8cb05cb02a2d2f70c926e5388b3970d40e8c96f7952b5a0ad50ef21edf91bd1b0c0e700f5cf4653  gemspec.patch
"
